package com.hollycrm.unicom.lockservice;

import java.io.Serializable;

/**
 * <p>Title: </p>
 * <p>Description: </p>
 * <p>Copyright: Copyright (c) 2004</p>
 * <p>Company: </p>
 * @author Tian Kai
 * @version 1.0
 */

public class LockObject implements Serializable {

    protected String lockID;
    protected String locker;
    protected String lockType;
    protected long lockTimeMillis;//use of memory
    protected long spanTimeMillis;//use of memory
    protected String lockTime;//use of database
    protected String lockEndTime;//use of database

    /**
     * use of memory
     * @return boolean
     */
    public boolean isValid() {
        return (lockTimeMillis + spanTimeMillis) != 0 &&
            System.currentTimeMillis() < (lockTimeMillis + spanTimeMillis);
    }
    public String getLockID() {
        return lockID;
    }
    public void setLockID(String lockID) {
        this.lockID = lockID;
    }
    public String getLocker() {
        return locker;
    }
    public void setLocker(String locker) {
        this.locker = locker;
    }
    public String getLockType() {
        return lockType;
    }
    public void setLockType(String lockType) {
        this.lockType = lockType;
    }
    public long getLockTimeMillis() {
        return lockTimeMillis;
    }
    public void setLockTimeMillis(long lockTimeMillis) {
        this.lockTimeMillis = lockTimeMillis;
    }
    public long getSpanTimeMillis() {
        return spanTimeMillis;
    }
    public void setSpanTimeMillis(long spanTimeMillis) {
        this.spanTimeMillis = spanTimeMillis;
    }
    public String getLockTime() {
        return lockTime;
    }
    public void setLockTime(String lockTime) {
        this.lockTime = lockTime;
    }
    public String getLockEndTime() {
        return lockEndTime;
    }
    public void setLockEndTime(String lockEndTime) {
        this.lockEndTime = lockEndTime;
    }

}
